<?php
/**
 * Introduction: 供应商商品表  stock_suppliers
 */

namespace Common\Model;


use Think\Model;

class StockSuppliersModel extends Model
{
    //定义数据库连接信息
    protected $connection;

    //定义表名
    protected $tableName = 'stock_suppliers';

    /**
     * 初始化
     */
    public function _initialize()
    {

        $this->connection = C('Databaese');

    }

    /**
     * 获取供应仓库信息
     * @param int $id
     */
    public function getStockShopInfoById($id)
    {
        $fields = ['shopid'];
        $record = $this->where("id=$id")->field($fields)->find();
        if (!empty($record)) {
            $model = new StockShopsModel();
            $stockShopInfo = $model->getInfoById($record['shopid']);
        }
        return $stockShopInfo;
    }

}